﻿#region Namespace imports

using System;
using System.Collections.Generic;
using System.Linq;

#endregion

namespace AdventureGame
{
    internal class Hero
    {
        private static Int32 _acc = _baseAcc + _armorAcc;
        private static Int32 _armorAcc;
        private static Int32 _armorAtk;
        private static Int32 _armorDef;
        private static Int32 _armorEva;
        private static Int32 _armorMag;
        private static Int32 _armorRes = 2;
        private static Int32 _atk = _baseAtk + _armorAtk;
        private static Int32 _baseAcc = 85;
        private static Int32 _baseAtk = 8;
        private static Int32 _baseDef = 3;
        private static Int32 _baseEva = 20;
        private static Int32 _baseMag = 5;
        private static Int32 _baseRes = 2;
        private static Int32 _def = _baseDef + _armorDef;
        private static Int32 _eva = _baseEva + _armorEva;
        private static Int32 _hp = 50;
        private static Int32 _pot = 2;
        private static Int32 _manaPot = 1;
        private static Int32 _res = _armorRes + _baseRes;
        private static Int32 _mag = _baseMag + _armorMag;
        
        public static List<Item> _Inventory = new List<Item>();

        private static Boolean _paralyzed;
        private static Boolean _poisoned;

        private static Int32 _spe = 4;

        private static Boolean _spellBlast;
        private static Boolean _spellEnhance;
        private static Boolean _spellHeal;
        private static Boolean _spellParalyze;
        private static Boolean _spellPoison;
        private static Boolean _spellWeaken;

        private static Int32 _level = 1;
        private static Int32 _toNextLevel = 100;
        private static Int32 _xp;

        private static Boolean _password1;
        private static Boolean _PortalDestroyed;
        private static Boolean _camp;
        private static Boolean _zombies;
        private static String _equipped = "bare hands";
        private static String _worn = "nothing";

        public static Boolean SpellHeal
        {
            get { return _spellHeal; }
            set { _spellHeal = value; }
        }

        public static Boolean SpellBlast
        {
            get { return _spellBlast; }
            set { _spellBlast = value; }
        }

        public static Boolean SpellEnhance
        {
            get { return _spellEnhance; }
            set { _spellEnhance = value; }
        }

        public static Boolean SpellParalyze
        {
            get { return _spellParalyze; }
            set { _spellParalyze = value; }
        }

        public static Boolean SpellPoison
        {
            get { return _spellPoison; }
            set { _spellPoison = value; }
        }

        public static Boolean SpellWeaken
        {
            get { return _spellWeaken; }
            set { _spellWeaken = value; }
        }

        public static bool Password1
        {
            get { return _password1; }
            set { _password1 = value; }
        }

        public static bool Portal
        {
            get { return _PortalDestroyed; }
            set { _PortalDestroyed = value; }
        }
        public static bool Camp
        {
            get { return _camp; }
            set { _camp = value; }
        }
        public static bool Zombies
        {
            get { return _zombies; }
            set { _zombies = value; }
        }

        public static Int32 GrabHp()
        {
            return _hp;
        }

        public static Int32 GrabSpe()
        {
            return _spe;
        }

        public static Int32 GrabPot()
        {
            return _pot;
        }

        public static Int32 GrabManaPot()
        {
            return _manaPot;
        }

        public static Int32 GrabAtk()
        {
            return _atk;
        }

        public static Int32 GrabDef()
        {
            return _def;
        }

        public static Int32 GrabAcc()
        {
            return _acc;
        }

        public static Int32 GrabRes()
        {
            return _res;
        }

        public static Int32 GrabMag()
        {
            return _mag;
        }

        public static Int32 GrabEva()
        {
            return _eva;
        }

        public static Boolean GrabPoison()
        {
            return _poisoned;
        }

        public static Boolean GrabParalyze()
        {
            return _paralyzed;
        }

        public static Int32 GrabLevel()
        {
            return _level;
        }

        public static Int32 GrabXp()
        {
            return _xp;
        }

        public static Int32 GrabToNextLevel()
        {
            return _toNextLevel;
        }

        public static Int32 GrabBaseAtk()
        {
            return _armorAtk;
        }


        public static void SetPoison(Boolean poisoned)
        {
            _poisoned = poisoned;
        }

        public static void SetParalyze(Boolean paralyzed)
        {
            _paralyzed = paralyzed;
        }

        public static void SetHp(Int32 newhp)
        {
            _hp -= newhp;
        }

        public static void SetAtk(Int32 newatk)
        {
            _baseAtk += newatk;
            _atk = _baseAtk + _armorAtk;
        }

        public static void SetDef(Int32 newdef)
        {
            _def += newdef;
        }

        public static void SetEva(Int32 neweva)
        {
            _eva += neweva;
        }

        public static void SetAcc(Int32 newacc)
        {
            _acc += newacc;
        }

        public static void SetMag(Int32 newmag)
        {
            _mag += newmag;
        }

        public static void SetRes(Int32 newres)
        {
            _res += newres;
        }

        public static void SetPot(Int32 newpot)
        {
            _pot += newpot;
        }

        public static void SetManaPot(Int32 newmanapot)
        {
            _manaPot += newmanapot;
        }

        public static void SetXp(Int32 xp)
        {
            _xp += xp;
        }


        public static void LevelUp()
        {
            Random rand = new Random();
            Console.WriteLine("Press any key to level up");
            Console.ReadKey();

            _hp += rand.Next(30);
            _mag += rand.Next(4);
            _res += rand.Next(4);
            _spe += rand.Next(4);
            _baseAtk += rand.Next(5);
            _baseDef += rand.Next(5);
            _baseAcc += rand.Next(15);
            _baseEva += rand.Next(15);

            _xp = 0;
            _level++;
            _toNextLevel += 200;

            _def = _armorDef + _baseDef;
            _eva = _armorEva + _baseEva;
            _atk = _armorAtk + _baseAtk;
            _acc = _armorAcc + _baseAcc;

            Console.WriteLine("You Leveled up!!!!!");
            Console.WriteLine();
            Console.WriteLine("Your new stats:");
            Console.WriteLine("Hp: {0}", GrabHp());
            Console.WriteLine("Atk: {0}", GrabAtk());
            Console.WriteLine("Def: {0}", GrabDef());
            Console.WriteLine("Eva: {0}", GrabEva());
            Console.WriteLine("Acc: {0}", GrabAcc());
            Console.WriteLine("Mag: {0}", GrabMag());
            Console.WriteLine("Res: {0}", GrabRes());
            Console.WriteLine("Potions: {0}", GrabPot());
            Console.WriteLine("Mana potions: {0}", GrabManaPot());
            Console.WriteLine("Spells: {0}", GrabSpe());
            Console.WriteLine("Spells known:");
            if (SpellBlast)
            {
                Console.WriteLine("\tBlast");
            }
            if (SpellParalyze)
            {
                Console.WriteLine("\tParalyze");
            }
            if (SpellPoison)
            {
                Console.WriteLine("\tPoison");
            }
            if (SpellHeal)
            {
                Console.WriteLine("\tHeal");
            }
            if (SpellWeaken)
            {
                Console.WriteLine("\tWeaken");
            }
            Console.WriteLine("Level: {0}", _level);
            Console.WriteLine("Xp to next level {0}", _toNextLevel);
        }


        public static Boolean attack(Int32 enemyEva)
        {
            Random rand = new Random();
            Int32 random1 = rand.Next(100);
            Int32 hit = _acc - enemyEva;
            Boolean bHit = false;
            if (hit < 1)
            {
                hit = 1;
            }
            if (random1 <= hit)
            {
                bHit = true;
            }
            else
            {
                bHit = false;
            }
            if (bHit)
            {
                Console.WriteLine("You hit with your {0}!", _equipped);
            }
            else
            {
                Console.WriteLine("You miss.");
            }
            return bHit;
        }

        public static Int32 hit(Int32 enemyDef)
        {
            Random rand = new Random();
            Int32 random1 = rand.Next(_atk);
            Int32 random2 = rand.Next(enemyDef);
            Int32 damage = random1 - random2;
            if (damage < 1)
            {
                Console.WriteLine("You deal no damage!");
                return 0;
            }
            Console.WriteLine("You deal {0} damage!", damage);
            return damage;
        }


        public static Int32 Blast(Int32 enemyRes)
        {
            if (!SpellBlast)
            {
                Console.WriteLine("You don't know that spell!");
                Console.WriteLine("To learn it, find its scroll and press 'r' to read.");
                return 0;
            }

            if (_spe >= 1)
            {
                Random rand = new Random();
                Int32 random1 = rand.Next(10);
                Int32 random2 = rand.Next(10);
                Int32 damage = (random1*_mag) - (random2*enemyRes);
                if (damage < _mag)
                {
                    damage = _mag;
                }
                Console.WriteLine("You unleash your magic!");
                Console.WriteLine("You inflict {0} damage!", damage);
                _spe--;
                return damage;
            }
            else
            {
                Console.WriteLine("You're out of magic");
                return 0;
            }
        }

        public static Boolean Poison(Int32 enemyRes)
        {
            if (!SpellPoison)
            {
                Console.WriteLine("You don't know that spell!");
                Console.WriteLine("To learn it, find its scroll and press 'r' to read.");
                return false;
            }

            if (_spe >= 1)
            {
                Console.WriteLine("You unleash your magic!");
                Random rand = new Random();
                Int32 random1 = rand.Next(100);
                Int32 hit = 70 + _mag - enemyRes;
                Boolean bHit = false;
                if (random1 <= hit)
                {
                    Console.WriteLine("You poison it!");
                    bHit = true;
                    _spe--;
                    return bHit;
                }
                else
                {
                    Console.WriteLine("Your magic fails!");
                    _spe--;
                    return bHit;
                }
            }
            else
            {
                Console.WriteLine("You're out of magic");
                return false;
            }
        }

        public static Boolean Weaken(Int32 enemyRes)
        {
            if (!SpellWeaken)
            {
                Console.WriteLine("You don't know that spell!");
                Console.WriteLine("To learn it, find its scroll and press 'r' to read.");
                return false;
            }

            if (_spe >= 1)
            {
                Console.WriteLine("You unleash your magic!");
                Random rand = new Random();
                Int32 random1 = rand.Next(100);
                Int32 hit = 70 + _mag - enemyRes;
                Boolean bHit = false;
                if (random1 <= hit)
                {
                    Console.WriteLine("You weaken it!");
                    bHit = true;
                    _spe--;
                    return bHit;
                }
                else
                {
                    Console.WriteLine("Your magic fails!");
                    _spe--;
                    return bHit;
                }
            }
            else
            {
                Console.WriteLine("You're out of magic");
                return false;
            }
        }


        public static void Enhance()
        {
            if (!SpellEnhance)
            {
                Console.WriteLine("You don't know that spell!");
                Console.WriteLine("To learn it, find its scroll and press 'r' to read.");
                return;
            }

            if (_spe >= 1)
            {
                Random rand = new Random();

                Console.WriteLine("You unleash your magic!");
                Console.WriteLine("You feel strength coursing through your body!");

                _atk += rand.Next(_mag);
                _def += rand.Next(_mag);
                _acc += rand.Next(_mag);
                _eva += rand.Next(_mag);

                Console.WriteLine("Your atk rose!");
                Console.WriteLine("Your acc rose!");
                Console.WriteLine("Your def rose!");
                Console.WriteLine("Your eva rose!");
            }
            else
            {
                Console.WriteLine("You're out of magic");
            }
        }

        public static Boolean Paralyze(Int32 enemyRes)
        {
            if (!SpellParalyze)
            {
                Console.WriteLine("You don't know that spell!");
                Console.WriteLine("To learn it, find its scroll and press 'r' to read.");
                return false;
            }

            if (_spe >= 1)
            {
                Console.WriteLine("You unleash your magic!");
                Random rand = new Random();
                Int32 random1 = rand.Next(100);
                Int32 hit = 70 + _mag - enemyRes;
                Boolean bHit = false;
                if (random1 <= hit)
                {
                    Console.WriteLine("You paralyze it!");
                    bHit = true;
                    _spe--;
                    return bHit;
                }
                else
                {
                    Console.WriteLine("Your magic fails!");
                    _spe--;
                    return bHit;
                }
            }
            else
            {
                Console.WriteLine("You're out of magic");
                return false;
            }
        }

        public static void Heal()
        {
            if (!SpellHeal)
            {
                Console.WriteLine("You don't know that spell!");
                Console.WriteLine("To learn it, find its scroll and press 'r' to read.");
                return;
            }
            if (_spe >= 1)
            {
                Random rand = new Random();
                Console.WriteLine("You unleash your magic!");
                Int32 healing = rand.Next(10) + _mag*3;
                _hp += healing;
                Console.WriteLine("You heal {0} damage!", healing);
                _spe--;
            }

            else
            {
                Console.WriteLine("You're out of magic");
                return;
            }
        }

        public static void Potion()
        {
            if (_pot >= 1)
            {
                Random rand = new Random();
                Console.WriteLine("You quaff a potion!");
                Int32 healing = rand.Next(10);
                _hp += healing;
                Console.WriteLine("You heal {0} damage!", healing);
                _pot--;
                if (GrabPoison())
                {
                    SetPoison(false);
                    Console.WriteLine("You recover from your poisoning");
                }
                if (GrabParalyze())
                {
                    SetParalyze(false);
                    Console.WriteLine("You recover from your paralysis");
                }
            }

            else
            {
                Console.WriteLine("You're out of potions");
                return;
            }
        }

        public static void ManaPotion()
        {
            if (_manaPot >= 1)
            {
                Random rand = new Random();
                Console.WriteLine("You quaff a mana potion!");
                Int32 healing = rand.Next(3);
                _spe += healing;
                Console.WriteLine("You regain {0} spells!", healing);
                _manaPot--;
            }

            else
            {
                Console.WriteLine("You're out of mana potions");
                return;
            }
        }


        public static void inventory()
        {
            Console.WriteLine("You have...");
            foreach (Item item in _Inventory)
            {
                Console.WriteLine("a {0}", item.Name);
            }
            Console.WriteLine("{0} potions", _pot);
            Console.WriteLine("and {0} mana potions", _manaPot);
        }

        public static void AddToInventory(String item)
        {
            if (item == "sword")
            {
                Item sword = new Item("sword");
                sword.Attack = 3;
                sword.Accuracy = 15;
                sword.Magic = 0;

                _Inventory.Add(sword);
            }
            if (item == "silver key")
            {
                Item silverKey = new Item("silver key");
                

                _Inventory.Add(silverKey);

            }
            if (item == "axe")
            {
                Item axe = new Item("axe");
                axe.Attack = 8;
                axe.Accuracy = -10;
                axe.Magic = 0;

                _Inventory.Add(axe);
            }
            if (item == "burnt axe")
            {
                Item baxe = new Item("burnt axe");
                baxe.Attack = 12;
                baxe.Accuracy = -15;
                baxe.Magic = 1;

                _Inventory.Add(baxe);
            }
            if (item == "spear")
            {
                Item spear = new Item("spear");
                spear.Attack = 7;
                spear.Accuracy = 0;
                spear.Magic = 0;

                _Inventory.Add(spear);
            }
            if (item == "halberd")
            {
                Item halberd = new Item("halberd");
                halberd.Attack = 10;
                halberd.Accuracy = -5;
                halberd.Magic = 2;

                _Inventory.Add(halberd);
            }
            if (item == "scimitar")
            {
                Item halberd = new Item("halberd");
                halberd.Attack = 15;
                halberd.Accuracy = -10;
                halberd.Magic = 2;

                _Inventory.Add(halberd);
            }
            
            if (item == "magic sword")
            {
                Item magicSword = new Item("magic sword");
                magicSword.Attack = 3;
                magicSword.Accuracy = 10;
                magicSword.Magic = 4;

                _Inventory.Add(magicSword);
            }

            if (item == "magic wand")
            {
                Item magicWand = new Item("magic wand");
                magicWand.Attack = 1;
                magicWand.Accuracy = 0;
                magicWand.Magic = 8;

                _Inventory.Add(magicWand);
            }

            if (item == "ice brand")
            {
                Item Brand = new Item("ice brand");
                Brand.Attack = 6;
                Brand.Accuracy = 5;
                Brand.Magic = 2;

                _Inventory.Add(Brand);
            }

            if (item == "fireforged blade")
            {
                Item Blade = new Item("fireforged blade");
                Blade.Attack = 10;
                Blade.Accuracy = -5;
                Blade.Magic = 5;

                _Inventory.Add(Blade);
            }

            if (item == "excalibur")
            {
                Item Excalibur = new Item("excalibur");
                Excalibur.Attack = 12;
                Excalibur.Accuracy = 30;
                Excalibur.Magic = 10;

                _Inventory.Add(Excalibur);
            }

            if (item == "armor")
            {
                Item armor = new Item("armor");
                armor.Defense = 5;
                armor.Evasiveness = -10;
                armor.Resistance = 0;

                _Inventory.Add(armor);
            }
            if (item == "burnt armor")
            {
                Item barmor = new Item("burnt armor");
                barmor.Defense = 4;
                barmor.Evasiveness = -20;
                barmor.Resistance = 8;

                _Inventory.Add(barmor);
            }
            if (item == "chain mail")
            {
                Item chainMail = new Item("chain mail");
                chainMail.Defense = 9;
                chainMail.Evasiveness = -20;
                chainMail.Resistance = 0;

                _Inventory.Add(chainMail);
            }
            if (item == "leather")
            {
                Item leather = new Item("leather");
                leather.Defense = 8;
                leather.Evasiveness = 0;
                leather.Resistance = 2;

                _Inventory.Add(leather);
            }
            if (item == "full plate")
            {
                Item fullplate = new Item("full plate");
                fullplate.Defense = 13;
                fullplate.Evasiveness = -30;
                fullplate.Resistance = 0;

                _Inventory.Add(fullplate);
            }
            if (item == "magic armor")
            {
                Item magicArmor = new Item("magic armor");
                magicArmor.Defense = 5;
                magicArmor.Evasiveness = -20;
                magicArmor.Resistance = 4;

                _Inventory.Add(magicArmor);
            }

            if (item == "talisman")
            {
                Item talisman = new Item("talisman");
                talisman.Defense = 1;
                talisman.Evasiveness = 10;
                talisman.Resistance = 8;

                _Inventory.Add(talisman);
            }

            if (item == "rod of theo")
            {
                Item Theo = new Item("Rod of Theo");
                Theo.Attack = -10;
                Theo.Accuracy = -10;
                Theo.Magic = 15;

                _Inventory.Add(Theo);
            }

            else if (item == "red scroll")
            {
                Item scrollBlast = new Item("red scroll");

                scrollBlast.Scroll = "blast";

                _Inventory.Add(scrollBlast);
            }
            else if (item == "white scroll")
            {
                Item scrollHeal = new Item("white scroll");

                scrollHeal.Scroll = "heal";

                _Inventory.Add(scrollHeal);
            }
            else if (item == "violet scroll")
            {
                Item scrollEnhance = new Item("violet scroll");

                scrollEnhance.Scroll = "enhance";

                _Inventory.Add(scrollEnhance);
            }
            else if (item == "green scroll")
            {
                Item scrollPoison = new Item("green scroll");

                scrollPoison.Scroll = "poison";

                _Inventory.Add(scrollPoison);
            }
            else if (item == "blue scroll")
            {
                Item scrollParalyze = new Item("blue scroll");

                scrollParalyze.Scroll = "paralyze";

                _Inventory.Add(scrollParalyze);
            }
            else if (item == "purple scroll")
            {
                Item scrollWeaken = new Item("purple scroll");

                scrollWeaken.Scroll = "weaken";

                _Inventory.Add(scrollWeaken);
            }
            else if (item == "potion")
            {
                _pot++;
            }
            else if (item == "mana potion")
            {
                _manaPot++;
            }
        }

        public static void unequip()
        {
            _armorAtk = 0;
            _armorAcc = 0;
            _armorMag = 0;

            Console.WriteLine("You're fighting with your bare hands.", _equipped);
            _equipped = "bare hands";

            Console.WriteLine("Your current atk is: {0}", _atk);
            Console.WriteLine("Your current acc is: {0}", _acc);
            Console.WriteLine("Your current mag is: {0}", _mag);
        }

        public static void TakeOff()
        {
            _armorDef = 0;
            _armorEva = 0;
            _armorRes = 0;

            Console.WriteLine("You are unarmored.", _worn);
            _worn = "nothing";

            Console.WriteLine("Your current def is: {0}", _def);
            Console.WriteLine("Your current eva is: {0}", _eva);
            Console.WriteLine("Your current res is: {0}", _res);
        }


        public static void Equip(String item)
        {
            Boolean bequip = false;
            Int32 i = 0;
            for (i = 0; i <= _Inventory.Count() - 1; i++)
            {
                if (Area.FindItem(_Inventory[i], item))
                {
                    bequip = true;
                    break;
                }
                if (i >= _Inventory.Count() - 1)
                {
                    Console.WriteLine("You don't have a {0}!", item);
                    break;
                }
            }

            if (bequip)
            {
                _armorAtk = _Inventory[i].Attack;
                _armorAcc = _Inventory[i].Accuracy;
                _armorMag = _Inventory[i].Magic;

                _atk = _armorAtk + _baseAtk;
                _acc = _armorAcc + _baseAcc;
                _mag = _armorMag + _baseMag;

                if (_atk <= 0)
                {
                    _atk = 1;
                }
                if (_acc <= 0)
                {
                    _acc = 1;
                }
                if (_mag <= 0)
                {
                    _mag = 1;
                }

                _equipped = item;

                Console.WriteLine("{0} equipped", item);
                Console.WriteLine("Your current atk is: {0}", _atk);
                Console.WriteLine("Your current acc is: {0}", _acc);
                Console.WriteLine("Your current mag is: {0}", _mag);
            }


            if (!bequip)
            {
                Console.WriteLine("You don't have a {0}.", item);
            }
        }

        public static void Don(String item)
        {
            Boolean bequip = false;
            Int32 i = 0;
            for (i = 0; i <= _Inventory.Count() - 1; i++)
            {
                if (Area.FindItem(_Inventory[i], item))
                {
                    bequip = true;
                    break;
                }
                if (i >= _Inventory.Count() - 1)
                {
                    Console.WriteLine("You don't have a {0}!", item);
                    break;
                }
            }

            if (bequip)
            {
                _armorDef = _Inventory[i].Defense;
                _armorEva = _Inventory[i].Evasiveness;
                _armorRes = _Inventory[i].Resistance;

                _def = _armorDef + _baseDef;
                _eva = _armorEva + _baseEva;
                _res = _armorRes + _baseRes;

                if (_def <= 0)
                {
                    _def = 1;
                }
                if (_eva <= 0)
                {
                    _eva = 1;
                }
                if (_res <= 0)
                {
                    _res = 1;
                }

                _worn = item;

                Console.WriteLine("{0} donned", item);
                Console.WriteLine();
                Console.WriteLine("Your current def is: {0}", _def);
                Console.WriteLine("Your current eva is: {0}", _eva);
                Console.WriteLine("Your current res is: {0}", _res);
            }


            if (!bequip)
            {
                Console.WriteLine("You don't have a {0}.", item);
            }
        }

        public static void Read(String item)
        {
            Boolean beread = false;
            Int32 i = 0;
            for (i = 0; i <= _Inventory.Count() - 1; i++)
            {
                if (Area.FindItem(_Inventory[i], item))
                {
                    beread = true;
                    break;
                }
                if (i >= _Inventory.Count() - 1)
                {
                    Console.WriteLine("You don't have a {0}!", item);
                    break;
                }
            }

            if (beread)
            {
                if (_Inventory[i].Name == "red scroll")
                {
                    if (!SpellBlast)
                    {
                        Console.WriteLine("You leaned the spell Blast!");
                        Console.WriteLine("Under the spell command, press 'b' to unleash massive magical damage!");
                        SpellBlast = true;
                    }
                    else
                    {
                        Console.WriteLine("To cast Blast, press 'b' under 'spell' to unleash massive magical damage.");
                    }
                }

                else if (_Inventory[i].Name == "white scroll")
                {
                    if (!SpellHeal)
                    {
                        Console.WriteLine("You leaned the spell Heal!");
                        Console.WriteLine("Under the spell command, press 'h' to heal yourself");
                        SpellHeal = true;
                    }
                    else
                    {
                        Console.WriteLine("To cast Heal, press 'h' under 'spell' to heal yourself.");
                    }
                }

                else if (_Inventory[i].Name == "violet scroll")
                {
                    if (!SpellEnhance)
                    {
                        Console.WriteLine("You leaned the spell Enhance!");
                        Console.WriteLine("Under the spell command, press 'e' to to temporarily increase your stats.");
                        SpellEnhance = true;
                    }
                    else
                    {
                        Console.WriteLine("To cast Enhance, press 'e' under 'spell' to temporarily increase your stats.");
                    }
                }

                else if (_Inventory[i].Name == "green scroll")
                {
                    if (!SpellPoison)
                    {
                        Console.WriteLine("You leaned the spell Poison!");
                        Console.WriteLine("Under the spell command, press 'po' to poison your enemy!");
                        SpellPoison = true;
                    }
                    else
                    {
                        Console.WriteLine("To cast Blast, press 'po' under 'spell' to poison your enemy.");
                    }
                }
                else if (_Inventory[i].Name == "blue scroll")
                {
                    if (!SpellParalyze)
                    {
                        Console.WriteLine("You leaned the spell Paralyze!");
                        Console.WriteLine("Under the spell command, press 'pa' to hold your enemies in place!");
                        SpellParalyze = true;
                    }
                    else
                    {
                        Console.WriteLine("To cast Blast, press 'pa' under 'spell' to hold your enemies in place.");
                    }
                }
                else if (_Inventory[i].Name == "purple scroll")
                {
                    if (!SpellWeaken)
                    {
                        Console.WriteLine("You leaned the spell Weaken!");
                        Console.WriteLine("Under the spell command, press 'w' to steal strength from the enemy!");
                        SpellWeaken = true;
                    }
                    else
                    {
                        Console.WriteLine("To cast Blast, press 'w' under 'spell' to steal strength from the enemy.");
                    }
                }


                else
                {
                    Console.WriteLine("The scroll us utterly unreadable.");
                }
            }


            else
            {
                Console.WriteLine("You don't have a {0}.", item);
            }
        }


        public static Boolean Weapons()
        {
            List<Item> tools = new List<Item>();


            foreach (Item weapon in _Inventory)
            {
                if (weapon.Attack >= 1)
                {
                    tools.Add(weapon);
                }
            }
            if (tools.Count() >= 1)
            {
                Console.WriteLine("You have...");
                foreach (Item item in tools)
                {
                    Console.WriteLine(item.Name);
                }
                return true;
            }
            else
            {
                Console.WriteLine("You don't have any weapons!");
                return false;
            }
        }

        public static Boolean Armors()
        {
            List<Item> tools = new List<Item>();

            foreach (Item weapon in _Inventory)
            {
                if (weapon.Defense >= 1)
                {
                    tools.Add(weapon);
                }
            }
            if (tools.Count() >= 1)
            {
                Console.WriteLine("You have...");
                foreach (Item item in tools)
                {
                    Console.WriteLine(item.Name);
                }
                return true;
            }
            else
            {
                Console.WriteLine("You don't have any armor!");
                return false;
            }
        }

        public static Boolean Scrolls()
        {
            List<Item> tools = new List<Item>();


            foreach (Item scroll in _Inventory)
            {
                if (scroll.Scroll != null)
                {
                    tools.Add(scroll);
                }
            }
            if (tools.Count() >= 1)
            {
                Console.WriteLine("You have...");
                foreach (Item item in tools)
                {
                    Console.WriteLine(item.Name);
                }
                return true;
            }
            else
            {
                Console.WriteLine("You don't have any scrolls!");
                return false;
            }
        }

        public static void ResetStats()
        {
            _atk = _baseAtk + _armorAtk;
            _acc = _baseAcc + _armorAcc;
            _mag = _armorMag + _baseMag;
            _eva = _baseEva + _armorEva;
            _def = _baseDef + _armorDef;
            _res = _baseRes + _armorRes;
        }

        static public bool Key1()
        {
            foreach (Item weapon in _Inventory)
            {
                if (weapon.Name == "silver key")
                    return true;

            }
            return false;
        }

        }

    }


